package com.apes.auto.car.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @ClassName CarMatchingRule
 * @Description 车型配件匹配规则
 * @Author pengyb
 * @Date 2019/9/11 16:20
 * @Version 1.0
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = CarMatchingRule.CONST_TABLE_NAME)
public class CarMatchingRule extends Model {
    public static final String CONST_TABLE_NAME = "dc_car_matching_rule";

    @Id
    @Column(name = "id", length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "车型配件匹配规则")
    private String id;

    @NotNull
    @Column(name = "produt_code", length = 32)
    @Comment("配件名称编码")
    private String produtCode;

    @NotNull
    @Column(name = "produt_name", length = 64)
    @Comment("配件名称")
    private String produtName;

    @NotNull
    @Column(name = "field_name", length = 32)
    @Comment("字段名称")
    private String fieldName;

    @NotNull
    @Column(name = "chinese_name", length = 16)
    @Comment("中文名称")
    private String chineseName;

    @Column(name = "data_type_code", length = 4)
    @Comment("数据类型编码")
    private String dataTypeCode;

    @Column(name = "data_type_name", length = 4)
    @Comment("数据类型名称")
    private String dataTypeName;

    @Column(name = "matching_rule", length = 2)
    @Comment("匹配规则")
    private Integer matchingRule;

    @Column(name = "matching_value", length = 64)
    @Comment("匹配值")
    private String matchingValue;

    @Column(name = "matching_value_explain", length = 64)
    @Comment("匹配值说明")
    private String matchingValueExplain;

    @NotNull
    @Column(name = "car_id", length = 32)
    @Comment("车型ID")
    private String carId;

    @Column(name = "timestamp", length = 36)
    @Comment("时间戳")
    private String timestamp;

    @Column(name = "remark", length = 128)
    @Comment("备注")
    private String remark;


}
